/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gmovil_jpa.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author castlerock
 */
@Entity
@Table(name = "tipo_pago_plan")
@NamedQueries({
    @NamedQuery(name = "TipoPagoPlan.findAll", query = "SELECT t FROM TipoPagoPlan t"),
    @NamedQuery(name = "TipoPagoPlan.findByIdTipoPagoPlan", query = "SELECT t FROM TipoPagoPlan t WHERE t.idTipoPagoPlan = :idTipoPagoPlan"),
    @NamedQuery(name = "TipoPagoPlan.findByTipoPagoPlan", query = "SELECT t FROM TipoPagoPlan t WHERE t.tipoPagoPlan = :tipoPagoPlan")})
public class TipoPagoPlan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tipo_pago_plan")
    private Integer idTipoPagoPlan;
    @Basic(optional = false)
    @Column(name = "tipo_pago_plan")
    private String tipoPagoPlan;
    @OneToMany(mappedBy = "tipoPagoPlan")
    private List<Plan> planList;

    public TipoPagoPlan() {
    }

    public TipoPagoPlan(Integer idTipoPagoPlan) {
        this.idTipoPagoPlan = idTipoPagoPlan;
    }

    public TipoPagoPlan(Integer idTipoPagoPlan, String tipoPagoPlan) {
        this.idTipoPagoPlan = idTipoPagoPlan;
        this.tipoPagoPlan = tipoPagoPlan;
    }

    public Integer getIdTipoPagoPlan() {
        return idTipoPagoPlan;
    }

    public void setIdTipoPagoPlan(Integer idTipoPagoPlan) {
        this.idTipoPagoPlan = idTipoPagoPlan;
    }

    public String getTipoPagoPlan() {
        return tipoPagoPlan;
    }

    public void setTipoPagoPlan(String tipoPagoPlan) {
        this.tipoPagoPlan = tipoPagoPlan;
    }

    public List<Plan> getPlanList() {
        return planList;
    }

    public void setPlanList(List<Plan> planList) {
        this.planList = planList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoPagoPlan != null ? idTipoPagoPlan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoPagoPlan)) {
            return false;
        }
        TipoPagoPlan other = (TipoPagoPlan) object;
        if ((this.idTipoPagoPlan == null && other.idTipoPagoPlan != null) || (this.idTipoPagoPlan != null && !this.idTipoPagoPlan.equals(other.idTipoPagoPlan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gmovil_jpa.entidades.TipoPagoPlan[idTipoPagoPlan=" + idTipoPagoPlan + "]";
    }

}
